figure('Position',[1 1 500 300],'Units','inches')
set(gcf,'Units','pixels')
get(gcf,'Position')
set(gcf,'Units','pixels','Position',[1 1 500 300],'Units',...
   'inches')
get(gcf,'Position')
